/**
 * Created by shenbo on 2017/8/29.
 */
import multiChannel from '../../../../api/config/channel/multi-channel'
import * as globalTypes from '../../../../mutation-types'
/**
 * @param {Object} data
 */
export const saveGlobalSet = ({commit, state, rootState, dispatch}, data) => {
  return multiChannel.saveGlobalSet(data)
    .then(response => {
      if (response.success) {
        return response
      }
    })
    .catch(() => {
      commit(globalTypes.SET_ERROR, 'message.default_tips')
    })
}
export const getGlobalSetById = ({commit, state, rootState, dispatch}, data) => {
  return multiChannel.getGlobalSetById(data)
    .then(response => {
      if (response.success) {
        return response
      }
    })
    .catch(() => {
      commit(globalTypes.SET_ERROR, 'message.default_tips')
    })
}
